package com.gxa.web_admin.controller.drivingManagement;

import com.gxa.common.base.RespResult;
import com.gxa.modules.dto.drivingManagement.QueryCoachInfoDTO;
import com.gxa.modules.entity.CoachInfo;
import com.gxa.modules.service.drivingManagementService.CoachInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/coachInfo")
//@RequiresPermissions(value = {"system:coachInfo"})
public class CoachInfoController {//教练管理

    @Autowired
    private CoachInfoService coachInfoService;

    @GetMapping("/addCoach")//添加教练
    public RespResult addCoach(CoachInfo coachInfo){

        return coachInfoService.addCoach(coachInfo);
    }

    @GetMapping("/queryCoachInfo")//查询全部教练
    public RespResult queryCoachInfo(QueryCoachInfoDTO queryCoachInfoDTO){

        return coachInfoService.queryCoachInfo(queryCoachInfoDTO);
    }

    @GetMapping("/queryCoachByCoachNumberOrCoachName")//查询id教练信息
    public RespResult queryCoachByCoachNumberOrCoachName(Integer coachNumber,String coachName){

        return coachInfoService.queryCoachByCoachNumberOrCoachName(coachNumber,coachName);
    }

    @PostMapping("/updateCoach")
    public RespResult updateCoach(CoachInfo coachInfo){//更新教练信息

        return coachInfoService.updateCoach(coachInfo);
    }
}
